define([
  'jquery',
  'views/View',
  'hbs!template/subscribers/subscriber-detail'
], function($, View, template){
  var SubscriberDetail = View.extend({
    events: {
      "click button[name=back]":  "back"
    },
    
    initialize: function(options) {
      this.template = template;
      this.model.bind("change", this.render, this);
      this.model.bind("error_fetch", this.errorFetch, this);
    },

    errorFetch: function() {
      var error = new batzen.AlertMessage({title: "Ha ocurrido un error. Perdone las molestias", type: "error"});
      state.addAlertMessage(error);
    }
  });

  return SubscriberDetail;
});